﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DbSharp.Framework.DbObject
{

    /// <summary>
    /// Usually, DbCommand.ExecuteScalar() only returns value, but we need value type. 
    /// This class will contain both value and value type for scalar result
    /// </summary>
    public class DbCmdScalarResult
    {
        public DbCmdScalarResult(object value, int valueType)
        {
            m_Value = value;
            m_ValueType = valueType;
        }


        private object m_Value;
        private int m_ValueType;

        public int ValueType
        {
            get { return m_ValueType; }
            //set { m_ValueType = value; }
        }


        public object Value
        {
            get { return m_Value; }
            //set { m_Value = value; }
        }

        public override string ToString()
        {
            string result = string.Empty;
            if (m_Value != null)
            {
                result = m_Value.ToString();
            }
            return result;
        }
    }
}
